package com.sentiment.database.bean;

import org.bson.Document;
import org.bson.types.ObjectId;


public class WebsiteInfo {

	
	public static final String dbName = "SentimentDB";
	public static final String collection = "Website";
	
	private ObjectId _id;
	private String website;
	private String date;
	
	public WebsiteInfo() {
		super();
	}
	
	public String get_id() {
		return _id.toString();
	}

	public void set_id(String _id) {
		this._id = new ObjectId(_id);
	}

	public String getWebsite() {
		return website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public WebsiteInfo(Document doc){
		super();
		_id = doc.getObjectId("_id");
		date = doc.getString("date");
		website = doc.getString("website");
		
	}
	
	public Document toDocument(){
		return new Document("date", date).append("website", website);
	}
	

	public WebsiteInfo(String website, String date) {
		super();
		this.website = website;
		this.date = date;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return super.toString();
	}

	public Document toDocument_id() {
		return new Document("_id", _id).append("date", date).append("website", website);
	}
	
}
